package com.ruoyi.preferential.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.preferential.mapper.SyPreferentialUserMapper;
import com.ruoyi.preferential.domain.SyPreferentialUser;
import com.ruoyi.preferential.service.ISyPreferentialUserService;

/**
 * 用户优惠卷Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-12-23
 */
@Service
public class SyPreferentialUserServiceImpl implements ISyPreferentialUserService 
{
    @Autowired
    private SyPreferentialUserMapper syPreferentialUserMapper;

    /**
     * 查询用户优惠卷
     * 
     * @param userId 用户优惠卷主键
     * @return 用户优惠卷
     */
    @Override
    public SyPreferentialUser selectSyPreferentialUserByUserId(Long userId)
    {
        return syPreferentialUserMapper.selectSyPreferentialUserByUserId(userId);
    }

    /**
     * 查询用户优惠卷列表
     * 
     * @param syPreferentialUser 用户优惠卷
     * @return 用户优惠卷
     */
    @Override
    public List<SyPreferentialUser> selectSyPreferentialUserList(SyPreferentialUser syPreferentialUser)
    {
        return syPreferentialUserMapper.selectSyPreferentialUserList(syPreferentialUser);
    }

    /**
     * 新增用户优惠卷
     * 
     * @param syPreferentialUser 用户优惠卷
     * @return 结果
     */
    @Override
    public int insertSyPreferentialUser(SyPreferentialUser syPreferentialUser)
    {
        return syPreferentialUserMapper.insertSyPreferentialUser(syPreferentialUser);
    }

    /**
     * 修改用户优惠卷
     * 
     * @param syPreferentialUser 用户优惠卷
     * @return 结果
     */
    @Override
    public int updateSyPreferentialUser(SyPreferentialUser syPreferentialUser)
    {
        return syPreferentialUserMapper.updateSyPreferentialUser(syPreferentialUser);
    }

    /**
     * 批量删除用户优惠卷
     * 
     * @param userIds 需要删除的用户优惠卷主键
     * @return 结果
     */
    @Override
    public int deleteSyPreferentialUserByUserIds(Long[] userIds)
    {
        return syPreferentialUserMapper.deleteSyPreferentialUserByUserIds(userIds);
    }

    /**
     * 删除用户优惠卷信息
     * 
     * @param userId 用户优惠卷主键
     * @return 结果
     */
    @Override
    public int deleteSyPreferentialUserByUserId(Long userId)
    {
        return syPreferentialUserMapper.deleteSyPreferentialUserByUserId(userId);
    }
}
